package org.semanticflash.rdf.script
{
	

	import org.semanticflash.rdf.values.IRDFValueHolder;
	import org.semanticflash.rdf.values.RDFValue;
	



	/**
	 * 
	 * 
	 * @author aldo.bucchi@gmail.com
	 * 
	 */
	public class RDFTypedNode implements IRDFValueHolder
	{


		private var _factory:RDFNodeFactory;

		/**
		 * 
		 * The factory that created this typed node
		 * 
		 * @return 
		 * 
		 */		
		public function get factory( ):RDFNodeFactory
		{
			return _factory;		
		}




		private var _node:RDFNode;

		/**
		 * 
		 * The non-typed node that is wrapped by this typed node
		 * 
		 * @return 
		 * 
		 */
		public function get node( ):RDFNode
		{
			return _node;
		}


		
		
		/**
		 * 
		 * The real rdf value that is being wrapped by this typed node
		 * 
		 * @return 
		 * 
		 */		
		public function get rdfValue():RDFValue
		{
			return _node.rdfValue;
		}
		
		
		
		
		/**
		 * 
		 * Since we have an empty constructor, this is the way that the factory
		 * passes construction parameters
		 * 
		 * @param factory
		 * @param node
		 * @return 
		 * 
		 */		
		internal function initializeFromFactory( factory:RDFNodeFactory, node:RDFNode ):void
		{
		
			_factory = factory;
			_node = node;
			
			initialize( );
		
		}
		
		
		/**
		 * 
		 * You can hook your instantiation logic here
		 * 
		 */		
		protected function initialize( ):void
		{
		
		
		}
		
		
		
		
	}
	
	
}